import {ref} from 'vue'
import useLoading from './useLoading'

export default function useTable() {

    const TableRef = ref()

    const data = ref([])

    const rowSelection = ref({
        type: 'checkbox',
        showCheckedAll: true,
        onlyCurrent: false,
    });

    const pagination = ref({
        pageSize: 10,
        total: 0,
    })

    const bordered = ref({
        wrapper: false,
        cell: false,
        headerCell: false,
        bodyCell: false,
    })

    const scrollbar = ref({
        type: 'track',
        outerClass: '',
        outerStyle: '',
    })

    const scroll = ref({
        x: '100%',
        minWidth: 920,
        y: '100%',
    })

    return {
        TableRef,
        data,
        rowSelection,
        pagination,
        bordered,
        scrollbar,
        scroll,
        useLoading,
    }
}
